<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="top.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>创建新文件夹</title>
  </head>
  
  <body>
  
    	<div class="container" style="width:800px">
		  <div class="row">
			<div class="span9">
				<form action="addfolder.jspx" method="post" id="form">
			        <fieldset style="margin-left:100px;margin-top:30px">
			        	
		        		 <legend>创建新文件夹</legend>
				          <div class="control-group">
				            <label for="input01" class="control-label">文件夹名称</label>
				            <div class="controls">
				              <input type="text" style="height:32px" name="foldername" id="input01" class="span5">
				              <span style="color:red" id="input01_msg"></span>
				            </div>
				          </div>
				          
				          <div class="form-actions">
				            <button style="margin-left:100px" class="btn btn-primary" type="submit">保存</button>
				            <a class="btn" href="folder.jspx">返回</a>
				          </div>
			         
			        </fieldset>
	      		</form>          
	          	
			</div>
		  </div>
		</div>
	<script type="text/javascript">
		document.getElementById("form").onsubmit=function(){
			
			var input01 = document.getElementById("input01").value;

			if(input01.trim() == "") {
				
				document.getElementById("input01_msg").innerHTML = "请输入文件夹名称";
				document.getElementById("input01").focus();
				return false;
			}
			
		};
		
		document.getElementById("input01").onblur = function(){
		
			var input01 = document.getElementById("input01").value;
			if(input01.trim() == "") {
				document.getElementById("input01").value = "";
				document.getElementById("input01_msg").innerHTML = "请输入文件夹名称";
				document.getElementById("input01").focus();
			}else{
				document.getElementById("input01_msg").innerHTML = "";
			}
		};
		
		document.getElementById("input01").onkeydown = function(){
			document.getElementById("input01_msg").innerHTML = "";
		};
	</script>
  </body>
</html>
